Optimal. Leaf size=67 \[ \frac {3}{2} i \text {Li}_2\left (-i e^{i x}\right )-\frac {3}{2} i \text {Li}_2\left (i e^{i x}\right )-3 i x \tan ^{-1}\left (e^{i x}\right )+\frac {\sec (x)}{2}-\frac {1}{2} x \tan (x) \sec (x) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.14, antiderivative size = 67, normalized size of antiderivative = 1.00, number of steps used = 19, number of rules used = 6, integrand size = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.600, Rules used = {4431, 4181, 2279, 2391, 4413, 4185} \[ \frac {3}{2} i \text {PolyLog}\left (2,-i e^{i x}\right )-\frac {3}{2} i \text {PolyLog}\left (2,i e^{i x}\right )-3 i x \tan ^{-1}\left (e^{i x}\right )+\frac {\sec (x)}{2}-\frac {1}{2} x \tan (x) \sec (x) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2279
Rule 2391
Rule 4181
Rule 4185
Rule 4413
Rule 4431
Rubi steps
\begin {align*} \int x \cos (2 x) \sec ^3(x) \, dx &=\int \left (x \sec (x)-x \sec (x) \tan ^2(x)\right ) \, dx\\ &=\int x \sec (x) \, dx-\int x \sec (x) \tan ^2(x) \, dx\\ &=-2 i x \tan ^{-1}\left (e^{i x}\right )-\int \log \left (1-i e^{i x}\right ) \, dx+\int \log \left (1+i e^{i x}\right ) \, dx+\int x \sec (x) \, dx-\int x \sec ^3(x) \, dx\\ &=-4 i x \tan ^{-1}\left (e^{i x}\right )+\frac {\sec (x)}{2}-\frac {1}{2} x \sec (x) \tan (x)+i \operatorname {Subst}\left (\int \frac {\log (1-i x)}{x} \, dx,x,e^{i x}\right )-i \operatorname {Subst}\left (\int \frac {\log (1+i x)}{x} \, dx,x,e^{i x}\right )-\frac {1}{2} \int x \sec (x) \, dx-\int \log \left (1-i e^{i x}\right ) \, dx+\int \log \left (1+i e^{i x}\right ) \, dx\\ &=-3 i x \tan ^{-1}\left (e^{i x}\right )+i \text {Li}_2\left (-i e^{i x}\right )-i \text {Li}_2\left (i e^{i x}\right )+\frac {\sec (x)}{2}-\frac {1}{2} x \sec (x) \tan (x)+i \operatorname {Subst}\left (\int \frac {\log (1-i x)}{x} \, dx,x,e^{i x}\right )-i \operatorname {Subst}\left (\int \frac {\log (1+i x)}{x} \, dx,x,e^{i x}\right )+\frac {1}{2} \int \log \left (1-i e^{i x}\right ) \, dx-\frac {1}{2} \int \log \left (1+i e^{i x}\right ) \, dx\\ &=-3 i x \tan ^{-1}\left (e^{i x}\right )+2 i \text {Li}_2\left (-i e^{i x}\right )-2 i \text {Li}_2\left (i e^{i x}\right )+\frac {\sec (x)}{2}-\frac {1}{2} x \sec (x) \tan (x)-\frac {1}{2} i \operatorname {Subst}\left (\int \frac {\log (1-i x)}{x} \, dx,x,e^{i x}\right )+\frac {1}{2} i \operatorname {Subst}\left (\int \frac {\log (1+i x)}{x} \, dx,x,e^{i x}\right )\\ &=-3 i x \tan ^{-1}\left (e^{i x}\right )+\frac {3}{2} i \text {Li}_2\left (-i e^{i x}\right )-\frac {3}{2} i \text {Li}_2\left (i e^{i x}\right )+\frac {\sec (x)}{2}-\frac {1}{2} x \sec (x) \tan (x)\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 0.28, size = 146, normalized size = 2.18 \[ \frac {1}{4} \left (6 i \text {Li}_2\left (-i e^{i x}\right )-6 i \text {Li}_2\left (i e^{i x}\right )+6 x \log \left (1-i e^{i x}\right )-6 x \log \left (1+i e^{i x}\right )+\frac {x}{\sin (x)-1}+\frac {x}{\left (\sin \left (\frac {x}{2}\right )+\cos \left (\frac {x}{2}\right )\right )^2}+\frac {2 \sin \left (\frac {x}{2}\right )}{\cos \left (\frac {x}{2}\right )-\sin \left (\frac {x}{2}\right )}-\frac {2 \sin \left (\frac {x}{2}\right )}{\sin \left (\frac {x}{2}\right )+\cos \left (\frac {x}{2}\right )}\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 2.07, size = 144, normalized size = 2.15 \[ \frac {3 \, x \cos \relax (x)^{2} \log \left (i \, \cos \relax (x) + \sin \relax (x) + 1\right ) - 3 \, x \cos \relax (x)^{2} \log \left (i \, \cos \relax (x) - \sin \relax (x) + 1\right ) + 3 \, x \cos \relax (x)^{2} \log \left (-i \, \cos \relax (x) + \sin \relax (x) + 1\right ) - 3 \, x \cos \relax (x)^{2} \log \left (-i \, \cos \relax (x) - \sin \relax (x) + 1\right ) - 3 i \, \cos \relax (x)^{2} {\rm Li}_2\left (i \, \cos \relax (x) + \sin \relax (x)\right ) - 3 i \, \cos \relax (x)^{2} {\rm Li}_2\left (i \, \cos \relax (x) - \sin \relax (x)\right ) + 3 i \, \cos \relax (x)^{2} {\rm Li}_2\left (-i \, \cos \relax (x) + \sin \relax (x)\right ) + 3 i \, \cos \relax (x)^{2} {\rm Li}_2\left (-i \, \cos \relax (x) - \sin \relax (x)\right ) - 2 \, x \sin \relax (x) + 2 \, \cos \relax (x)}{4 \, \cos \relax (x)^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int x \cos \left (2 \, x\right ) \sec \relax (x)^{3}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.21, size = 102, normalized size = 1.52 \[ \frac {i \left (x \,{\mathrm e}^{3 i x}-x \,{\mathrm e}^{i x}-i {\mathrm e}^{3 i x}-i {\mathrm e}^{i x}\right )}{\left ({\mathrm e}^{2 i x}+1\right )^{2}}-\frac {3 x \ln \left (1+i {\mathrm e}^{i x}\right )}{2}+\frac {3 x \ln \left (1-i {\mathrm e}^{i x}\right )}{2}+\frac {3 i \dilog \left (1+i {\mathrm e}^{i x}\right )}{2}-\frac {3 i \dilog \left (1-i {\mathrm e}^{i x}\right )}{2} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F] time = 0.00, size = 0, normalized size = 0.00 \[ -\frac {{\left (x \sin \left (3 \, x\right ) - x \sin \relax (x) - \cos \left (3 \, x\right ) - \cos \relax (x)\right )} \cos \left (4 \, x\right ) - {\left (2 \, x \sin \left (2 \, x\right ) + 2 \, \cos \left (2 \, x\right ) + 1\right )} \cos \left (3 \, x\right ) - 2 \, {\left (x \sin \relax (x) + \cos \relax (x)\right )} \cos \left (2 \, x\right ) - 3 \, {\left (2 \, {\left (2 \, \cos \left (2 \, x\right ) + 1\right )} \cos \left (4 \, x\right ) + \cos \left (4 \, x\right )^{2} + 4 \, \cos \left (2 \, x\right )^{2} + \sin \left (4 \, x\right )^{2} + 4 \, \sin \left (4 \, x\right ) \sin \left (2 \, x\right ) + 4 \, \sin \left (2 \, x\right )^{2} + 4 \, \cos \left (2 \, x\right ) + 1\right )} \int \frac {{\left (\cos \left (2 \, x\right ) \cos \relax (x) + \sin \left (2 \, x\right ) \sin \relax (x) + \cos \relax (x)\right )} x}{\cos \left (2 \, x\right )^{2} + \sin \left (2 \, x\right )^{2} + 2 \, \cos \left (2 \, x\right ) + 1}\,{d x} - {\left (x \cos \left (3 \, x\right ) - x \cos \relax (x) + \sin \left (3 \, x\right ) + \sin \relax (x)\right )} \sin \left (4 \, x\right ) + {\left (2 \, x \cos \left (2 \, x\right ) + x - 2 \, \sin \left (2 \, x\right )\right )} \sin \left (3 \, x\right ) + 2 \, {\left (x \cos \relax (x) - \sin \relax (x)\right )} \sin \left (2 \, x\right ) - x \sin \relax (x) - \cos \relax (x)}{2 \, {\left (2 \, \cos \left (2 \, x\right ) + 1\right )} \cos \left (4 \, x\right ) + \cos \left (4 \, x\right )^{2} + 4 \, \cos \left (2 \, x\right )^{2} + \sin \left (4 \, x\right )^{2} + 4 \, \sin \left (4 \, x\right ) \sin \left (2 \, x\right ) + 4 \, \sin \left (2 \, x\right )^{2} + 4 \, \cos \left (2 \, x\right ) + 1} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 2.32, size = 63, normalized size = 0.94 \[ \frac {1}{2\,\cos \relax (x)}+x\,\mathrm {atanh}\left ({\mathrm {e}}^{x\,1{}\mathrm {i}}\,1{}\mathrm {i}\right )-\frac {x\,\sin \relax (x)}{2\,{\cos \relax (x)}^2}+\frac {\mathrm {polylog}\left (2,-{\mathrm {e}}^{x\,1{}\mathrm {i}}\,1{}\mathrm {i}\right )\,3{}\mathrm {i}}{2}-\frac {\mathrm {polylog}\left (2,{\mathrm {e}}^{x\,1{}\mathrm {i}}\,1{}\mathrm {i}\right )\,3{}\mathrm {i}}{2}-x\,\mathrm {atan}\left ({\mathrm {e}}^{x\,1{}\mathrm {i}}\right )\,4{}\mathrm {i} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int x \cos {\left (2 x \right )} \sec ^{3}{\relax (x )}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________